package com.huike.pmps.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.huike.pmps.model.entity.Expenses;
import org.apache.ibatis.annotations.Insert;

import java.util.List;

/**
 * 作者：谌贵斌(黑桃K)
 * 日期: 2888-08-08
 * 老师QQ: 272488352
 * 官方QQ交流群: 377748272
 * 刀客程序员官网：http://www.daoke360.com
 * 刀客程序员淘宝旗舰店：https://daoke360.taobao.com/
 */
public interface ExpensesDao extends BaseMapper<Expenses> {


    @Insert({
            "<script>",
            "insert into p_expenses ( ",
            "  year,                  ",
            "  month,                 ",
            "  submitter_name,        ",
            "  title,                 ",
            "  reason,                ",
            "  submit_amount,         ",
            "  payment_amount,        ",
            "  payment_date,          ",
            "  payee_info,            ",
            "  fee_type,              ",
            "  business_type,         ",
            "  remark,                ",
            "  region_id,             ",
            "  region_name,           ",
            "  province_id,           ",
            "  province_name,         ",
            "  po,                    ",
            "  financial_year,        ",
            "  fy_payment_amount,     ",
            "  product_line,          ",
            "  product_line_cost_name,",
            "  week_of_year,          ",
            "  season_of_year,        ",
            "  month_of_year,         ",
            "  create_time            ",
            ")values                  ",
            "<foreach collection='list' item='item' index='index' separator=','>",
            "(								",
            "  #{item.year},                ",
            "  #{item.month},               ",
            "  #{item.submitterName},       ",
            "  #{item.title},               ",
            "  #{item.reason},              ",
            "  #{item.submitAmount},        ",
            "  #{item.paymentAmount},       ",
            "  #{item.paymentDate},         ",
            "  #{item.payeeInfo},           ",
            "  #{item.feeType},             ",
            "  #{item.businessType},        ",
            "  #{item.remark},              ",
            "  #{item.regionId},            ",
            "  #{item.regionName},          ",
            "  #{item.provinceId},          ",
            "  #{item.provinceName},        ",
            "  #{item.po},                  ",
            "  #{item.financialYear},       ",
            "  #{item.fyPaymentAmount},     ",
            "  #{item.productLine},         ",
            "  #{item.productLineCostName}, ",
            "  #{item.weekOfYear},          ",
            "  #{item.seasonOfYear},        ",
            "  #{item.monthOfYear},         ",
            "  #{item.createTime}           ",
            ")                              ",
            "</foreach>",
            "</script>",

    })
    int insertBatchList(List<Expenses> list);
}
